<%-- 
    Document   : DetailCancelCar
    Created on : Nov 1, 2011, 11:45:07 PM
    Author     : MrKoi
--%>

<%@page import="DAL.CarBookBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page session="true" import="java.util.Collection" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>East2West Tours and Travels</title>
        <style type="text/css">
                .khun
                {
                    background-color:#f7f6f6;
                    width:490px;                    
                    margin-left:auto;
                    margin-right:auto;
                    margin-top:0px;
                }
                table
                {
                margin-left:auto;
                margin-right:auto;
                }
                .font
                {
                font-family:"Times New Roman", Times, serif;
                font-size:x-large;
                font-weight:bold;
                width:200px;
                height:30px;
                margin-left:auto;
                margin-right:auto;
                 color:#0707e7;
                }
                .noidung
                {
                font-family:"Times New Roman", Times, serif;
                color:black;
                font-size:medium;
                font-weight:bold;
                }
                .khun p
                {
                 margin-left:40px;
                 color:red;
                }
        </style>
    </head>
    <body>
    <%
        String total="";//username="",
        int bookid=0;
        if(session.getAttribute("Bookid")!=null)
            {
               //username=session.getAttribute("User").toString();
               bookid=Integer.parseInt(session.getAttribute("Bookid").toString());
               total=session.getAttribute("Refund").toString();

               
               CarBookBean cb=new CarBookBean();
               Collection coll=cb.SelectCarBookID(bookid);
               request.setAttribute("carb",coll);
            }
    %>
    <center>
                <span style="font-size: 20px;color: #343434;">Detail Book</span></center>  
    <div class="khun">
        <table border="0" width="490px" cellpadding="5" cellspacing="5">            
            <form action="ControllerCancelCarBook" method="get" name="detail" enctype="multipart/form-data">
                <tr>
                    <td></td>
                    <td><input type="hidden" name="bookid" value="<%=bookid%>" /></td>
                </tr>
                <tr>
                    <td colspan="2"><hr></td>
                </tr> 
                <tr>
                    <td colspan="2" class="noidung">Information Car rental</td>
                </tr>
               <c:forEach items="${carb}" var="cbid" >

                    <tr>
                        <td>Image:</td>
                        <td><img src="${cbid.image}" border="1" width="100px" height="100px"/></td>
                    </tr>
                    <tr>
                        <td>Driver:</td>
                        <td>${cbid.driver}</td>
                    </tr>
                    <tr>
                        <td>Pick Up Date:</td>
                        <td>${cbid.pickUpDate}</td>
                    </tr>
                    <tr>
                        <td>Drop Off Date:</td>
                        <td>${cbid.dropOffDate}</td>
                    </tr>
                    <tr>
                        <td>Time:</td>
                        <td>${cbid.time}</td>
                    </tr>
                    <tr>
                        <td>Date Rental:</td>
                        <td>${cbid.dateBooking}</td>
                    </tr>
                    <tr>
                        <td>Total Money:</td>
                        <td style="color:red;"><f:formatNumber value="${cbid.totalMoney}" pattern="$#,###" /></td></td>
                    </tr>
                </c:forEach>               
               <tr>
                    <td colspan="2"><hr></td>
                </tr> 
                <tr>
                        <td>Refund:</td>
                        <td style="color:red;" ><input type="hidden" name="refund" value="<%=total%>"/><f:formatNumber value="<%=total%>" pattern="$#,###" /></td></td>
                    </tr>
                <tr>
                    <tr>
                    <td colspan="2" class="noidung" style="color:red;">Click comfirm to cancel car rental</td>
                </tr> 
                <tr>
                    <td colspan="2"><hr></td>
                </tr> 
                <tr>
                    <td align="right"><input type="submit" name="comfirm" value="Comfirm"/></td>
                    
                 </form>
                    <form action="ControllerCancelCarBook" method="post" name="nocancel">
                       <td align="left">
                           <input type="submit" name="notcancel" value="Not Cancel" />
                        </td>
                    </form>
                </tr>
        </table>
        <br>
        <samp style="color:red;">Note:</samp><br>
        <p>The refund rules are given as below:<br>
            Before 1 day – 75%<br>
            2 days – 80%<br>
            3 days – 85%<br>
            4 days – 90%<br>
            5 days or more – 95%<br>
        </p>
        </div>
    </body>
</html>
